#include "LineMapItem.h"
#include "MapHandle.h"
#include "AbstractLineMapItem.h"

LineMapItem::LineMapItem()
: MapItem(MapItemType::Line)
{

}

LineMapItem::LineMapItem(const QVector<QPointF> &points)
: MapItem(MapItemType::Line)
{
	setPoints(points);
}

void LineMapItem::addPoint(const QPointF& point)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->addPoint(point);
}

void LineMapItem::removePointByIndex(int index)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->removePointByIndex(index);
}

void LineMapItem::addPoints(const QVector<QPointF> &points)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->addPoints(points);
}

void LineMapItem::setPoints(const QVector<QPointF> &points)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->setPoints(points);
}

const QVector<QPointF> & LineMapItem::getPoints() const
{
	return dynamic_cast<AbstractLineMapItem*>(d_ptr)->getPoints();
}

void LineMapItem::setPointVisible(bool pointVisible)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->setPointVisible(pointVisible);
}

bool LineMapItem::getPointVisible() const
{
	return dynamic_cast<AbstractLineMapItem*>(d_ptr)->getPointVisible();
}

void LineMapItem::setPointSize(int pointSize)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->setPointSize(pointSize);
}

int LineMapItem::getPointSize() const
{
	return dynamic_cast<AbstractLineMapItem*>(d_ptr)->getPointSize();
}

void LineMapItem::setPointColor(const QColor& pointColor)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->setPointColor(pointColor);
}

const QColor& LineMapItem::getPointColor() const
{
	return dynamic_cast<AbstractLineMapItem*>(d_ptr)->getPointColor();
}

void LineMapItem::setPointStyle(PointStyle::Style pointStyle)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->setPointStyle(pointStyle);
}

PointStyle::Style LineMapItem::getPointStyle() const
{
	return dynamic_cast<AbstractLineMapItem*>(d_ptr)->getPointStyle();
}

void LineMapItem::setWidth(double width)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->setWidth(width);
}

double LineMapItem::getWidth() const
{
	return dynamic_cast<AbstractLineMapItem*>(d_ptr)->getWidth();
}

void LineMapItem::setStyle(LineStyle::Style style)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->setStyle(style);
}

LineStyle::Style  LineMapItem::getStyle() const
{
	return dynamic_cast<AbstractLineMapItem*>(d_ptr)->getStyle();
}

void LineMapItem::setColor(const QColor& color)
{
	dynamic_cast<AbstractLineMapItem*>(d_ptr)->setColor(color);
}

const QColor& LineMapItem::getColor() const
{
	return dynamic_cast<AbstractLineMapItem*>(d_ptr)->getColor();
}

LineMapItem::~LineMapItem()
{

}

int LineMapItem::getPointCount()
{
	return dynamic_cast<AbstractLineMapItem*>(d_ptr)->getPointCount();
}

const QPointF& LineMapItem::getPoint(int index)
{
	return dynamic_cast<AbstractLineMapItem*>(d_ptr)->getPoint(index);
}

bool LineMapItem::alterPoint(int index, const QPointF& point)
{
	return  dynamic_cast<AbstractLineMapItem*>(d_ptr)->alterPoint(index,point);
}


